#include "stm32f1xx_hal.h"
#include "type.h"

#ifndef __MUART_H
#define __MUART_H

#define RECEIVELEN1 500 

#define USART_DMA_SENDING 1 
#define USART_DMA_SENDOVER 0 
#define RSDIR_R     HAL_GPIO_WritePin(RSDIR_GPIO_Port, RSDIR_Pin,GPIO_PIN_RESET);
#define RSDIR_T     HAL_GPIO_WritePin(RSDIR_GPIO_Port, RSDIR_Pin,GPIO_PIN_SET);

typedef struct  
{  
uint8_t receive_flag:1; 
uint8_t dmaSend_flag:1; 
uint16_t rx_len; 
uint8_t usartDMA_rxBuf[100];//DMA
}USART_RECEIVETYPE; 

extern USART_RECEIVETYPE UsartType1;
extern void UsartUserInit(void);
extern void UsartReceive_IDLE(UART_HandleTypeDef *huart);
extern void SendState(void);

#endif
